<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "sys_item_space".
 *
 * @property integer $id
 * @property integer $item_id
 * @property integer $space_id
 */
class SysItemSpace extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'sys_item_space';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['item_id', 'space_id'], 'integer']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'item_id' => 'Item ID',
            'space_id' => 'Space ID',
        ];
    }
    public function getGrpName()
    {
    	return $this->hasOne(GrpSpace::className(),['id'=>'space_id']);
    }
}
